import {useSelector,useDispatch} from 'react-redux'
import {addActionCreator} from '@/store/action/counterAction'
export default ()=>{
   const count=useSelector((state)=>{
        return state.count
    })
    const dis=useDispatch()
    return (<>
        <h1>React-redux-hooks版的计数器</h1>
        <div>{count}</div>
        <button onClick={()=>{
            dis(addActionCreator(3))
        }}>+</button>
    </>)
}